<?php

class Sc_Db_Users extends Sc_Db_Persistent
{
    protected $_name = 'users';

    protected $_primary = 'Id';

    protected $_instanceClass = 'Sc_User';
    
	public function authorize(Sc_User $user)
    {
        $where['Username = ?']   = $user->username;
        $where['Password = MD5(?)'] = $user->password;
        $where['Isvalid = ?'] = true;

        return $this->get($where);
    }
}